﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:view="clr-namespace:WordToTFS.View">

    

    <SolidColorBrush x:Key="TitleBarBackgroundBrush" Color="#EFEFF2" />
    <SolidColorBrush x:Key="BorderBrush" Color="#646464" />
    <SolidColorBrush x:Key="BorderBrushInactive" Color="#999999" />
    <SolidColorBrush x:Key="StatusForeground" Color="#5e5e5e" />
    <SolidColorBrush x:Key="StatusForegroundInactive" Color="#5e5e5e" />

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Margin="2"
                                   SnapsToDevicePixels="true"
                                   Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                                   StrokeDashArray="1 2"
                                   StrokeThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MetroButton" TargetType="Button">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="Background" Value="#fdfdfd" />
        <Setter Property="Foreground" Value="#444444" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="10 0 10 0" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Height" Value="23" />
        <Setter Property="Width" Value="75" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="Border"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}" />

                        <ContentPresenter Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              RecognizesAccessKey="True" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="OpacityMask" Value="#AA888888" />
                            <Setter Property="Margin" Value="2 1" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderThickness" Value="0" />
                            <Setter Property="Background" Value="#d5e1f2" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#FFB4B4B4" />
                            <Setter Property="BorderBrush" Value="#FFB4B4B4" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="TextWrapping" Value="Wrap"/>
    </Style>

    <Style TargetType="ListBox" >
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Continue" />
    </Style>

    <Style TargetType="ListBoxItem">
        <Setter Property="IsTabStop" Value="False" />
    </Style>

    <Style TargetType="ListView" >
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Continue" />
    </Style>

    <Style TargetType="ListViewItem">
        <Setter Property="IsTabStop" Value="False" />
    </Style>
    
    <DataTemplate x:Key="itemTemplate">
        <TextBlock TextWrapping="Wrap" Text="{Binding}"></TextBlock>
    </DataTemplate>
    
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="0,0,0,0" Background="Transparent"
                  BorderBrush="Black" BorderThickness="0,0,0,0" >
                            <ContentPresenter x:Name="ContentSite" 
                              
                              ContentSource="Header" Margin="12,2,12,2"
                              RecognizesAccessKey="True">
                              
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                           
                            <Setter TargetName="Border" Property="Background" Value="#c2d5f2" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <!--<Setter TargetName="Border" Property="Background" Value="DarkRed" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="Black" />-->
                            <!--<Setter Property="Foreground" Value="DarkGray" />-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ListStyle" TargetType="{x:Type ListBoxItem}">
        <Setter Property="BorderThickness" Value="0,0,0,1" />
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrushInactive}" />
    </Style>



    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#3399ff"  />
    <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#3399ff" />

    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border
        x:Name="Border" 
        Grid.ColumnSpan="2"
        CornerRadius="0"
        Background="White"
        BorderBrush="#FF707070"
        BorderThickness="1" />
            <Border 
        Grid.Column="0"
        CornerRadius="0" 
        Margin="1" 
        Background="White" 
        BorderBrush="#FF707070"
        BorderThickness="0,0,0,0" />
            <Path 
        x:Name="Arrow"
        Grid.Column="1"     
        Fill="Black"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="EditableComboBoxStyle" TargetType="ComboBox">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <!--<Setter Property="MinWidth" Value="0"/>-->
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="Template">
            
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton 
              Name="ToggleButton" 
              Template="{StaticResource ComboBoxToggleButton}" 
              Grid.Column="2" 
              Focusable="false"
              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
              ClickMode="Press">
                        </ToggleButton>
                        <!--<SnippetComboBoxSelectionBox>-->
                        <ContentPresenter
              Name="ContentSite"
              IsHitTestVisible="False" 
              Content="{TemplateBinding SelectionBoxItem}"
              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
              Margin="3,3,23,3"
              VerticalAlignment="Center"
              HorizontalAlignment="Left" />
                        <!--</SnippetComboBoxSelectionBox>-->
                        <TextBox x:Name="textbox"
              Style="{x:Null}" 
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="3,3,23,3"
              Focusable="False"
              Background="Transparent"
              Visibility="Visible"
               Width="{TemplateBinding IsReadOnly}"
              BorderThickness="0"
              Text="{TemplateBinding Text}"
              
              IsReadOnly="{TemplateBinding IsReadOnly}"
                                 />
                        <Popup 
              Name="Popup"
              Placement="Bottom"
              IsOpen="{TemplateBinding IsDropDownOpen}"
              Focusable="False"
              PopupAnimation="Slide">
                            <Grid 
                Name="DropDown"
                SnapsToDevicePixels="True"                
                MinWidth="{TemplateBinding ActualWidth}"
                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border 
                  x:Name="DropDownBorder"
                  Background="White"
                  BorderThickness="1"
                  BorderBrush="#FF707070"/>
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NonEditableComboBoxStyle" TargetType="ComboBox">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <!--<Setter Property="MinWidth" Value="0"/>-->
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton 
              Name="ToggleButton" 
              Template="{StaticResource ComboBoxToggleButton}" 
              Grid.Column="2" 
              Focusable="false"
              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
              ClickMode="Press">
                        </ToggleButton>
                        <!--<SnippetComboBoxSelectionBox>-->
                        <ContentPresenter
              Name="ContentSite"
              IsHitTestVisible="False" 
              Content="{TemplateBinding SelectionBoxItem}"
              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
              Margin="3,3,23,3"
              VerticalAlignment="Center"
              HorizontalAlignment="Left" />
                        <!--</SnippetComboBoxSelectionBox>-->
                        <TextBox x:Name="textbox"
              Style="{x:Null}" 
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="3,3,23,3"
              Focusable="True" 
              Background="Transparent"
              Visibility="Hidden"
               Width="{TemplateBinding IsReadOnly}"
              BorderThickness="0"
              IsReadOnly="{TemplateBinding IsReadOnly}"/>
                        <Popup 
              Name="Popup"
              Placement="Bottom"
              IsOpen="{TemplateBinding IsDropDownOpen}"
              
              Focusable="False"
              PopupAnimation="Slide">
                            <Grid 
                Name="DropDown"
                SnapsToDevicePixels="True"                
                MinWidth="{TemplateBinding ActualWidth}"
                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border 
                  x:Name="DropDownBorder"
                  Background="White"
                  BorderThickness="1"
                  BorderBrush="#FF707070"/>
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
    
    
